package xiao.ke.serviceinvoker1.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import xiao.ke.serviceinvoker1.entity.Book;


/**
 * @author XuXiaoK
 * @create 2020-01-22 21:10
 */
@Component
@FeignClient(value = "service-provider1", fallback = HelloClientFallback.class)
public interface BookService {

    /**
     * 调用书本服务的接口，获取一个Book实例
     */
    @GetMapping("book/{bookId}")
    Book getBook(@PathVariable("bookId") Integer bookId);
}
